package cn.wizzer.app.user.modules.models.enums;

import cn.wizzer.framework.util.Result;

import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * 银行卡类型枚举
 *
 * @author .
 */

public enum BankCardTypeEnum {
    // 普通银行卡
    BANKCARD("BANKCARD", 0),
    // 印度UPI
    UPI("UPI", 1),
    ;

    final public String NAME;
    final public int VALUE;


    BankCardTypeEnum(String name, int val) {
        NAME = name;
        VALUE = val;
    }

    public String getNAME() {
        return NAME;
    }

    public int getVALUE() {
        return VALUE;
    }

    /**
     * @return 获取枚举列表
     */
    public static List<Map<Object, Object>> toList(){
        BankCardTypeEnum[] values = BankCardTypeEnum.values();
        return Arrays.stream(values).map(enu -> Result.createHashMap("name", enu.NAME, "value", enu.toString()))
                .collect(Collectors.toList());
    }

}
